package com.ruoyi.ade.service.impl;

import java.util.List;

import com.ruoyi.ade.mapper.AdeLlmLabResultMapper;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ade.mapper.AdeLlmLabMapper;
import com.ruoyi.ade.domain.AdeLlmLab;
import com.ruoyi.ade.service.IAdeLlmLabService;
import org.springframework.transaction.annotation.Transactional;

/**
 * Ade LLM LabsService业务层处理
 * 
 * @author wxh
 * @date 2025-06-30
 */
@Service
public class AdeLlmLabServiceImpl implements IAdeLlmLabService 
{
    @Autowired
    private AdeLlmLabMapper adeLlmLabMapper;

    @Autowired
    private AdeLlmLabResultMapper adeLlmLabResultMapper;


    /**
     * 查询Ade LLM Labs
     * 
     * @param id Ade LLM Labs主键
     * @return Ade LLM Labs
     */
    @Override
    public AdeLlmLab selectAdeLlmLabById(Long id)
    {
        return adeLlmLabMapper.selectAdeLlmLabById(id);
    }

    /**
     * 查询Ade LLM Labs列表
     * 
     * @param adeLlmLab Ade LLM Labs
     * @return Ade LLM Labs
     */
    @Override
    public List<AdeLlmLab> selectAdeLlmLabList(AdeLlmLab adeLlmLab)
    {
        return adeLlmLabMapper.selectAdeLlmLabList(adeLlmLab);
    }

    /**
     * 新增Ade LLM Labs
     * 
     * @param adeLlmLab Ade LLM Labs
     * @return 结果
     */
    @Override
    public int insertAdeLlmLab(AdeLlmLab adeLlmLab)
    {
        adeLlmLab.setCreateTime(DateUtils.getNowDate());
        return adeLlmLabMapper.insertAdeLlmLab(adeLlmLab);
    }

    /**
     * 修改Ade LLM Labs
     * 
     * @param adeLlmLab Ade LLM Labs
     * @return 结果
     */
    @Override
    public int updateAdeLlmLab(AdeLlmLab adeLlmLab)
    {
        return adeLlmLabMapper.updateAdeLlmLab(adeLlmLab);
    }

    /**
     * 批量删除Ade LLM Labs
     * 
     * @param ids 需要删除的Ade LLM Labs主键
     * @return 结果
     */
    @Override
    @Transactional
    public int deleteAdeLlmLabByIds(Long[] ids)
    {
        for(Long id:ids)
            adeLlmLabResultMapper.deleteAdeLlmLabResultByLlmLabId(id);
        return adeLlmLabMapper.deleteAdeLlmLabByIds(ids);
    }

    /**
     * 删除Ade LLM Labs信息
     * 
     * @param id Ade LLM Labs主键
     * @return 结果
     */
    @Override
    @Transactional
    public int deleteAdeLlmLabById(Long id)
    {
        adeLlmLabResultMapper.deleteAdeLlmLabResultByLlmLabId( id);
        return adeLlmLabMapper.deleteAdeLlmLabById(id);
    }
}
